var $select=$('#select');
var $xlk=$('#xlk');//触发幕罩
var $qq=$('#qq');
var $YC=$('.display');
var $inputText=$('input[type="text"]');
var $foot=$('#foot');
var aA=[];
function fnNone(e,$m){
	$m.css('display','none');
	$(window).off('resize.mz');
	//e.stopPropagation();
}
function fnBlock(e,$m){
	if($m===$select){
        $m.css('pointer-events','none');
        setTimeout(()=>$m.css('pointer-events','auto'),30);
	}
	$m.css('display','block');
	console.log($m.css('pointer-events'));
	$(window).on('resize.mz',mH);
	//e.stopPropagation();
}
function fnSelectName(e){
	$xlk.children('span').text($('input[name="select"]:checked').val());
	fnNone(e,$select);
}
function fnA(e){
	alert('该功能暂没开通');
	//e.stopPropagation();
}
var fnRemove=($div)=>{//删除登录
	$div.animate({transform:'translate(19vw,-53vh) rotate(1080deg) scale(0.01,0.01)'},2000,()=>$div.remove());
}
var mH=()=>$('.m').height($(window).height());
(()=>{
	$YC.eq(1).on('tap',fnA);
	$('u').on('tap',fnA);
	$foot.children('a').on('tap',fnA);
	$('#mmdl').next().on('tap',fnA);
	$('.l.w100').on('tap',()=>{
		$div=$('<div class="jc b frowC" style="width:5rem;height:2.7rem;overflow:hidden;"></div>');
		$div.appendTo($(document.body))
		.html(`input1: ${$inputText.eq(0).val()} <br />input2: ${$inputText.eq(1).val()}`)
		.on('tap',()=>fnRemove($div));
	})
	//幕罩一
	$xlk.on('tap',function(e){fnBlock(e,$select)});
	$select.find('input').on('change',fnSelectName);

	//幕罩二
	$('#foot>span').on('tap',function(e){fnBlock(e,$qq)})
	$qq.children().children(':not(.hcenter)').on('tap',fnA)
	.last().next().on('tap',function(e){fnNone(e,$qq)})
	//密码登录
	$('#mmdl').on('tap',function(){
		if(!$YC.is('.yc')){
			$foot.children('a').addClass('yc');
			$YC.addClass('yc');
			$inputText.eq(0).val('').attr('placeholder','输入手机或邮箱');
			$inputText.eq(1).val('').attr({"placeholder":'输入密码',"type":'password'})
			$(this).text('免密码登录·海外手机登录');
		}else{
			$foot.children('a').removeClass('yc');
			$YC.removeClass('yc');
			$inputText.eq(0).val('').attr('placeholder','输入手机号');
			$inputText.eq(1).val('').attr({"placeholder":'输入密码',"type":'text'});
			$(this).text('密码登录');
		}
	})
	mH();
})();